Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation Extensions & Issues Pt 1 #3348

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

florianessl
Copy link
Member

@florianessl florianessl commented Feb 5, 2025

This PR collects all the minor patches I've done recently on the Player´s translation feature.
Basically I've split my working branch into 3, depending on how deep the changes would go.

Pt.2 would contain some changes to liblcf, to be able to store the selected language setting inside savefiles
Pt.3 is highly experimental & does all the unsafe, live patching of the interpreter state, to be able to switch languages mid-game

And if Pt.3 works out, maybe I'll proceed to experiment with some sort of AI-based auto-translation feature. Let's see.

Opening the language selection menu via custom command (Issue #2945):

Previously, the language selection has been hardcoded to be part of the title scene. This was an issue for games that use the "NewGame" flag & implemented their own title screen in-engine.
This PR implements a new scene type for the langue menu and also adds a way for this custom scene to be accessed via either of the currently provided "custom menu" options:

  • Maniac patch extension to "Open Save menu" (Code 11910) -> param[0] = 207 (Patch "Maniac" & "EasyRpg Extensions" have to be active)
  • "DirectMenu" patch -> [Patch variable] = 7

Also, I added support for accessing EasyRPGs "Settings" menu in this manner. This was previously commented out, but can now also be accessed via both of these ways, by using value "206" (Save Menu Cmd) or "6" (DirectMenuPatch)

Turning of the "Language" menu on title screen.

See feature request here: https://community.easyrpg.org/t/turning-off-the-menu-option-created-by-translation/1277

Two new config options have been added:

  • "LanguageInTitle"
  • "StartupLangSelect"

"LanguageInTitle" can be used to remove the "Language" options from the title screen entirely, similarly to the previously existing 'SettingsInTitle' config option.

As an alternative, a new way of accessing the Language select scene has been added via the "StartupLangSelect" option. If set, the menu is shown right before the actual title screen of the game is boot up.
Options are: "Never", "FirstStartup", "Always".
"FirstStartup" will try to look for existing save files & only show the language screen, if none are found.

Generate only a warning when no Language folder is found (Issue #3213)

As described in the issue, the player would generate an error & thus force the Player to exit, if it was started with the "--language" option for a game where no "Language" folder exists. This would also be an issue for loading up a savegame where the "translation" field is set.

Translating a game's title (Issue #3097)

A new field in "meta.ini" can be used to translate the game title into different languages. As in the vanilla RPG_RT.ini, the name for this option is "GameTitle".

Dynamic language switching in-game

In addition to the custom ways of accessing the language menu in-engine, I also added a new option to EasyRPG´s F1 Settings screen. This can't be deactivated at the moment, maybe another config-flag should be added for this? 🤔
This doesn't change the way translation is handled in-game (yet), so for the language-switch to be fully active, one has to leave the current map, so that the Player can properly refresh any currently active events.

For a futue PR I'd like to overhaul the way the language-switch works when in-game, so that even currently active interpreter stacks can be fully switched to another translation. I'll probably add a new command too for this, so prepare for some weird test game experiences where the game just randomly switches between languages in unexpected ways. xD

@github-actions github-actions bot added Window/Scenes Building Settings All about customizable features, storing and applying them Translation labels Feb 5, 2025
@Ghabry
Copy link
Member

Ghabry commented Feb 12, 2025

This looks useful, will consider this for 0.8.1


Good way to test is using the "EasyRPG Dev Simulator" as it has a German translation:

https://easyrpg.org/play/pr3348/?game=strpic


Though somehow your change crashes the language switch in emscripten, have to check this.


Also I think you forgot some files: I do not see the config options or the language switcher in the settings scene.

@Mimigris
Copy link

Could also try with Braingirl using translations from YNOproject, the game skips the title screen so it could work for this use-case. Guess I could some testings on my side too if I have time and don't forget.

@Ghabry
Copy link
Member

Ghabry commented Feb 12, 2025

Works for Braingirl.

Notable is that the Window is centered instead of the way the title screen does it.

Maybe could be altered because of aesthetics.

grafik

@Mimigris
Copy link

Works for Braingirl.

Notable is that the Window is centered instead of the way the title screen does it.

Maybe could be altered because of aesthetics.

grafik

Would probably work better for a lot of games seeing that the title screen graphic is the basis, though this case is not very much representative since said title screen picture is unused outside of those settings menu in EasyRPG due to the actual title screen being skipped.

@florianessl
Copy link
Member Author

I updated the options in Window_Settings & possibly (?) also fixed the async issue that caused the Web-Player to fail (I don't have a setup locally to test anything based on Emscripten at the moment but the changed lines might be a cause)

Because of the reliance on the title graphic & different needs, I gave this some thought & came up with some more suggestions for possible customizations. (Maybe we'd should open a ticket for these)

Suggested customization options for this scene:

Defining a background that is to be used for the "Language" scene:

  • This graphic would be picked from the "Title" folder.
  • If not set, then the standard title graphic is still used.

Overriding the "System" graphic to be used for the "Language" scene:

Depending on the choice of background, a dev might also want to use a different system file for this Scene.

Placement of the "Choices" box:

  • Some rough options like "Top", "Middle", "Bottom" or rather some exact X/Y placement?
  • Alignment of the window should probably an option. Otherwise, if it defaults to "Center", any time a new language is added, new actual X/Y coordinates would take effect. And depending on the choice of background this might cause undesired results.

--> Changing the placement of the choices window is something that would probably also be useful to finally implement for the standard Title Scene.
As of now, the standard choices here have been extended with three new options in EasyRPG Player: "Settings", "Import" & "Language" which mess with some title designs. Also there seem to be plenty of patched RPG_RT with changed title screens.

Suggested new commands:

Also, new command suggestions, so developers can implement their own language selection if they desire to do so:

  • ChangeLanguage
  • GetLanguageInfo (Output available languages/meta info to vars & strings)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building Settings All about customizable features, storing and applying them Translation Window/Scenes
Development

Successfully merging this pull request may close these issues.

3 participants